<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use App\Event\RechargeEvent;
use App\Model\AdminUsers;
use App\Model\HostInfo;
use App\Model\OcpcBaiduSearchLog;
use App\Model\OcpcTencentLog;
use App\Model\Service\GiftService;
use App\Model\User;
use App\Model\UserActLog;
use App\Model\UserProfile;
use Encore\Admin\Facades\Admin;
use Hyperf\DbConnection\Db;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Annotation\Controller;
use App\Middleware\JTAuthMiddleware;
use App\Service\Stat\StartService;
use Psr\EventDispatcher\EventDispatcherInterface;

/**
 * @Controller(prefix="stat")
 */
class StatController extends AbstractController
{
    /**
     * 启动上报
     * @RequestMapping(path="app_start", methods="post")
     */
    public function app_start(StartService $service)
    {
        return $service->response();
    }

    /**
     * 启动上报
     * @RequestMapping(path="test", methods="post")
     */
    public function test()
    {
//        $request = $this->request->all();
//
//        $giftService = new GiftService();
//        $ret = $giftService->proccessSysGift(3721, [
//            'host_cate' => 0,
//            'gift_id' => 25,
//            'gift_num' => env('USER_SYSGIFT_MAX_NUM', 50000),
//            'single_gift_num' => $request['num'],
//            'gift_expire_time' => env('USER_SYSGIFT_EXP_TIME', 120),
//        ]);
//var_dump($ret);
    }
}
